#pragma once

#include <stdio.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_system.h"
#include "nvs_flash.h"
#include "nvs.h"
#include "esp_log.h"

void user_nvs_init();
void user_nvs_erase();

bool user_nvs_u16_set(const char* name, uint16_t data);
esp_err_t user_nvs_u16_get(const char* name, uint16_t* data);

bool user_nvs_u8_set(const char* name, uint8_t data);
esp_err_t user_nvs_u8_get(const char* name, uint8_t* data);

esp_err_t user_nvs_array_set(const char* name, const void* data, size_t len);
int user_nvs_array_len_get(const char* name);
esp_err_t user_nvs_array_get(const char* name, uint8_t* data, size_t len_max);
